<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <span>{{fullName(123)}}</span>
    </div>
</body>
<script src="./js/vue.js"></script>
<script>
    Vue.config.productionTip = false;

    new Vue({
        el:"#app",
        data:{
            firstName:"T",
            lastName:"Mac"
        },
        computed: {
            fullName:{
                get() {
                    return function (flag) {
                        console.log(flag);
                        // 复杂逻辑计算
                        return `${this.firstName}-${this.lastName}`
                    }
                },
                set(val){}
            }
        }
        /*methods:{
            fullName(flag) {
                console.log(flag);
                // 复杂逻辑计算
                return `${this.firstName}-${this.lastName}`
            }
        }*/
        /*computed: {
            fullName(flag) {
                console.log(flag);
                // 复杂逻辑计算
                return `${this.firstName}-${this.lastName}`
            }
        }*/
    })
</script>
</html>